package com.cd.dao;

import com.cd.entity.Classes;
import com.cd.mapper.ClassesMapper;
import com.cd.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.io.IOException;
import java.util.List;

public class ClassesDao {
    //查询所有班级
    public List<Classes> findAll() throws IOException {
        try (SqlSession session = MybatisUtil.getSqlSession(true)) {
            ClassesMapper classesmapper = session.getMapper(ClassesMapper.class);
            return classesmapper.findAll();
        }
    }
}
